import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [{
	path: '/home',
	name: 'Home',
	component: () => import('../views/home.vue'),
},
{
	path: '/list',
	name: 'List',
	component: () => import('../views/list.vue'),
	meta: {
		keepAlive: true
	}
},
{
	path: '/detail',
	name: 'Detail',
	component: () => import('../views/detail.vue'),
},
{
	path: '/demo',
	name: 'Demo',
	component: () => import('../views/demo.vue'),
},
{
	path: '/form',
	name: 'Form',
	component: () => import('../views/form.vue'),
},
]

const router = createRouter({
	history: createWebHashHistory(),
	routes,
	scrollBehavior(to, from, savedPosition) {
		return { top: 0 };
	},
})

export default router